package fan;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Employee
 * Package: fan
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-09-04
 * Time: 20:57
 */

public class Employee implements Comparable<Employee>{
    private String name;
    private int age;
    private MyData birthday;

    public Employee() {
    }

    public Employee(String name, int age, MyData birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public MyData getBirthday() {
        return birthday;
    }

    public void setBirthday(MyData birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", birthday=" + birthday +
                '}';
    }

    @Override
    public int compareTo(Employee o) {
        //按照name从低到高排序
        return this.name.compareTo(o.name);
    }
}
